package com.lorianknights.rpg.screens
{
	
	import flash.display.Loader;
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.net.URLRequest;
	import flash.text.TextField;
	import com.lorianknights.rpg.screens.Screen;
	import com.lorianknights.rpg.screens.skins.ScreenLoadingSkin;
	import com.lorianknights.rpg.utils.Constants;
	
	public class ScreenLoading extends Screen
	{
		
		private var loadingSkin:ScreenLoadingSkin;
		private var loader:Loader = new Loader();
		public static const DEFAULT_LOADER_TXT:String = Constants.LOADER_TXT_SCRN;
		
		public function ScreenLoading()
		{
			
			super();
			
		}
		
		public override function init():void
		{
			
			var assetClass:Class = null;
			
			this.loadingSkin = new ScreenLoadingSkin();
			addChild(this.loadingSkin);
			
				if (this.loadingSkin == null)
				{
					
					assetClass = getDefinitionByName(Constants.SCREEN_LOADING_SKIN) as Class;
					this.skin.btnCancel = this.skin.getChildByName(Constants.BTN_CANCEL_STR) as MovieClip;
					this.skin.strTxt_load = this.skin.getChildByName(Constants.STR_TXT_LOAD) as TextField;
					this.skin = addChildAt(new assetClass(), 0) as MovieClip;
					
						if (this.skin.numChildren > 0)
						{
							
							addChild(this.skin);
							
						}
					
				}
				
				this.skin.btnCancel.addEventListener(MouseEvent.CLICK, onCancelClick);
				this.skin.btnCancel.addEventListener(MouseEvent.ROLL_OVER, onCancelHover);
				this.skin.btnCancel.addEventListener(MouseEvent.ROLL_OUT, onCancelOut);
				
		}
		
		private function
		
		private function onCancelClick(event:MouseEvent):void
		{
			
			this.gotoAndStop(Constants.LOGIN);
			
		}
		
		private function onCancelHover(event:MouseEvent):void
		{
			
			var mc:MovieClip = event.currentTarget as MovieClip;
			
				if (mc.currentLabel != Constants.IN)
				{
					
					mc.gotoAndPlay(Constants.IN);
					
				}
		}
		
		private function onCancelOut(event:MouseEvent):void
		{
			
			var mc:MovieClip = event.currentTarget as MovieClip;
			
				if (mc.currentLabel != Constants.OUT)
				{
					
					mc.gotoAndPlay(Constants.OUT);
					
				}
		}
		
		private function 
		
		
			
